<div class="dataInnBottom">

    <div class="dataHeader">
        <h4>Users</h4>
    </div>
    <div class="clr"></div>
    <div class="add-button">
        <input type="button" value="Add User" id="add-user-button">
    </div>
    <?php $this->addScriptPath('../application/views/scripts/'); ?>
    <?= $this->paginationControl($this->paginator, 'Sliding', 'paginator.phtml') ?>

    <div class="clr"></div>


    <table class="dataActions" width="100%" border="0" cellpadding="0" cellspacing="0" >

        <tr>                                                                                                               

            <th>Actions</th>
            <th><div class="subjectBox"><span>Name</span> <a href="#"><img src="<?= $this->baseURI(); ?>images/toparrow.gif" alt="" /></a> <a class="subjectBotClick" href="#"><img src="<?= $this->baseURI(); ?>images/downarrow.gif" alt="" /></a>
        </div>

        </th>

        <th>Email</th>
        <th>Role</th>
        <th>Department</th>
        <th>Status</th>
        </tr>
        <?php foreach ($this->paginator as $item) { ?>
            <tr>
                <td><a href="javascript:void(0)" onclick="deleteUser('<?=$item['id'];?>')"><img src="<?= $this->baseURI(); ?>images/cross.png" alt="" /></a> 
                    <a href="javascript:void(0)" onclick="editUser('<?=$item['id'];?>')"><img src="<?= $this->baseURI(); ?>images/pencil.png" alt="" /></a>
                </td>
                <td><?php echo $item['fname'] . ' ' . $item['lname']; ?></td>
                <td><?php echo $item['email']; ?></td>
                <td><?php echo $item['role']; ?></td>
                <td><?php echo ($item['role']=='superadmin')?'':$item['department']; ?></td>
                <td class="colGray"><?php echo $item['status']; ?></td>
            </tr>           
        <?php } ?>
    </table>
</div>
<script>
$( "#add-user-button" )
        .button()
        .click(function() {
            $("#add-user-form").load("<?= $this->baseURI(); ?>user/add");
            $( "#add-user-form" ).dialog( "open" );
        });
</script>